package 分支和循环.分支练习;

import java.util.Scanner;

public class 练习04 {

    public static void main(String[] args) {
        //用户按顺序输入年、月、日，求这一天是这一年的第几天
        Scanner sc=new Scanner(System.in);
        System.out.println("年");
        int year=sc.nextInt();
        System.out.println("月");
        int month=sc.nextInt();
        System.out.println("日");
        int day=sc.nextInt();
        int count=0;//今年第几天
        //2024 1 25  25天
        //2024 2 15  31天(一月份)+15天
        //2024 x y   (x-1)天数和+y
        switch (month){
            case 12:
                count+=30;//11
            case 11:
                count+=31;//10
            case 10:
                count+=30;//9
            case 9:
                count+=31;//8
            case 8:
                count+=31;//7
            case 7:
                count+=30;//6
            case 6:
                count+=31;
            case 5:
                count+=30;
            case 4:
                count+=31;
            case 3:
                count+=28;//闰年？
            case 2:
                count+=31;//31
            case 1:
                count+=day;//31+15
        }
        if((year%4==0&&year%100!=0)||(year%400==0)){
            count++;
        }
        System.out.println("今年第几天:"+count);

    }
}
